<template>
	<view>
		<view class="content">
			<!--
				作者：1169774483@qq.com
				时间：2018-08-24
				描述：用户信息
			-->
			<view class="user" @click="myDataTap">
				<text class="name" v-text="userData.periNickname || '点我完善信息'"></text>
				<image class="img" :src="userData.icon || '../../../static/images/user/moren.png'"></image>
				<text class="mui-icon mui-icon-arrowright"></text>
			</view>
			<!--
				作者：1169774483@qq.com
				时间：2018-08-24
				描述：账户信息
			-->
			<view class="account">
				<view class="account-num">
					<view class="num">
						<image class="icon" src="../../../static/images/user/lan.png"></image>0.00
					</view>
					<text class="font-12">账户余额</text>
				</view>
				<view class="btn">暂未开通</view>
			</view>
			<!--
				作者：1169774483@qq.com
				时间：2018-08-24
				描述：房屋信息
			-->
			<view class="user-house">
				<view class="item" v-for="(item,index) in houseList" :key="index" @click="houseListTap(item)">
					<view class="item-image">
						<image :src="item.imagesSrc" alt=""></image>
					</view>
					<text class="item-text" v-text="item.title"></text>
				</view>
			</view>
			<!--
				作者：1169774483@qq.com
				时间：2018-08-24
				描述：列表
			-->
			<view class="user-list">
				<view class="item" v-for="(item,index) in userList" :key="index" @click="unserListTap(item)">
					<view class="item-desc">
						<image :src="item.imagesSrc"></image>{{item.title}}
					</view>
					<text class="mui-icon mui-icon-arrowright"></text>
				</view>
				<view class="item" @click="accountClick">
					<view class="item-desc">
						<image src="../../../static/images/user/shezhi.png"></image>账号管理
					</view>
					<text class="mui-icon mui-icon-arrowright"></text>
				</view>
			</view>
		</view>
		<view class="bottom-bow"></view>
	</view>

</template>

<script>
	import { UserModel } from '../user.js'
	const User = new UserModel()
	export default {
		data() {
			return {
				userData: {},
				houseList: [{
					title: '房屋',
					imagesSrc: '../../../static/images/user/fang.png',
				}, {
					title: '账单',
					imagesSrc: '../../../static/images/user/zhang.png',
				}, {
					title: '车辆',
					imagesSrc: '../../../static/images/user/che.png',
					Url: 'user/myCar/myCar.html'
				}],
				userList: [{
					title: '我的活动',
					imagesSrc: '../../../static/images/user/dingdan.png',
					Url: 'neighbor/activity/my.html'
				}, {
					title: '我的商品',
					imagesSrc: '../../../static/images/user/dingdan.png',
					Url: 'neighbor/secondHand/my.html'
				}, {
					title: '我的收藏',
					imagesSrc: '../../../static/images/user/shoucang.png',
					Url: 'user/myCollect.html'
				}, {
					title: '报修记录',
					imagesSrc: '../../../static/images/user/baoxiu.png',
					Url: 'home/repairs/repairsRecords.html'
				}]
			}
		},
		onLoad (){
			User.getUserInfo()
				.then(data=>{
					this.userData = data
				})
		}
	}
</script>

<style lang="scss" scoped>
	@import '../../../common/scss/user.scss';
</style>
